<template>
  <div>
    <!-- 全屏图标 -->
    <svg-icon :icon-class="isFullScreen?'exit-fullscreen':'fullscreen'" class="fullscreen" @click="toggle" />
  </div>
</template>

<script>
import ScreenFull from 'screenfull/dist/screenfull'
export default {
  name: 'ScreenFull',
  data() {
    return {
      isFullScreen: false // 默认不全屏
    }
  },
  methods: {
    toggle() {
      this.isFullScreen = !this.isFullScreen
      ScreenFull.toggle()
    }
  }
}
</script>

<style lang="scss" scoped>
.fullscreen {
  width: 20px;
  height: 20px;
  fill: #fff;
  cursor: pointer;
}
</style>
